#!/usr/bin/python

import sys
from scapy import *

conf.iface = "eth0"

def printit(a):
	msg = str(a).split('000')
	if len(msg) == 3:
		srcdst = msg[1]
		src = msg[1].split(',')[0]
		dst = msg[1].split(',')[1]
		
		print "-------------------------------"
		print "Message from: " + src[4:] 
		print "Message to: " + dst[4:] 
		print "Message: " + msg[2]
		print "-------------------------------"

a = sniff(lfilter = lambda x: printit(x) ) 
